<?
include"../inc/config.inc.php";
if($_POST[MODE]=="ADD")
{
$date_id=$_POST[date_id];
$date_name=$_POST[date_name];
$sql="insert into date(date_id,date_name) values('$date_id','$date_name')";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=date.php'>";
}
if($_GET[MODE]=="DEL")
{
$date_id=$_GET[date_id];
$date_name=$_GET[date_name];
$sql="delete from date where date_id='$date_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=date.php'>";
}
if($_POST[MODE]=="EDIT")
{
$date_id=$_POST[date_id];
$date_name=$_POST[date_name];
$sql="UPDATE date set date_id='$date_id',date_name='$date_name' where date_id='$date_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='2;URL=date.php'>";
}
?>
